package rs.etf.kdp.server;

import java.io.Serializable;
import java.util.HashMap;

public class ComponentLocator implements Serializable {

	private static final long serialVersionUID = 8873859836244731456L;
	private long jobId;
	private HashMap<Long, Node> table; 
	
	public ComponentLocator(long jobid)
	{
		jobId = jobid;
		table = new HashMap<Long, Node>();
	}

	public synchronized void insert(long id, Node nameOfWorkstation)
	{
		table.put(id, nameOfWorkstation);
	}
	
	public synchronized Node getWorkstationById(long id)
	{
		return table.get(id);
	}
	
	public long getJobId() {
		return jobId;
	}

	public void setJobId(long jobId) {
		this.jobId = jobId;
	}

	public HashMap<Long, Node> getTable() {
		return table;
	}

	public void setTable(HashMap<Long, Node> table) {
		this.table = table;
	}
	

}
